home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / circuits / irsim-ca.2 / irsim-ca / irsim-cap-9.2 / src / ana11 / setsteps.c < prev    next >
C/C++ Source or Header  |  1993-01-15  |  1KB  |  51 lines

  1. /*
  2.  *     ********************************************************************* 
  3.  *     * Copyright (C) 1988, 1990 Stanford University.                     * 
  4.  *     * Permission to use, copy, modify, and distribute this              * 
  5.  *     * software and its documentation for any purpose and without        * 
  6.  *     * fee is hereby granted, provided that the above copyright          * 
  7.  *     * notice appear in all copies.  Stanford University                 * 
  8.  *     * makes no representations about the suitability of this            * 
  9.  *     * software for any purpose.  It is provided "as is" without         * 
  10.  *     * express or implied warranty.  Export of this software outside     * 
  11.  *     * of the United States of America may require an export license.    * 
  12.  *     *********************************************************************
  13.  */
  14.  
  15. #include "ana.h"
  16. #include "ana_glob.h"
  17.  
  18.  
  19. private void GetWidth( str )
  20.   char  *str;
  21.   {
  22.     TimeType  steps;
  23.     double    tmp;
  24.  
  25.     if( str == NULL )
  26.       {
  27.     XBell( display, 0 );
  28.     return;
  29.       }
  30.     tmp = atof( str );
  31.     steps = ns2d( tmp );
  32.     if( steps < 10 or (tims.start + steps) > max_time )
  33.       {
  34.     XBell( display, 0 );
  35.     return;
  36.       }
  37.  
  38.     tims.steps = steps;
  39.     tims.end = tims.start + steps;
  40.     RedrawTimes();
  41.     UpdateScrollBar();
  42.     DrawTraces( tims.start, tims.end );
  43.   }
  44.  
  45.  
  46. public void SetWidth( s )
  47.    char  *s;                /* the menu string => ignore it */
  48.   {
  49.     Query( "\nEnter Time Steps > ", GetWidth );
  50.   }
  51.